package cn.edu.suda.catalina.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.suda.catalina.bean.User;
import cn.edu.suda.catalina.dao.SampleDao;
import cn.edu.suda.catalina.service.SampleService;

import java.util.List;

@Service
public class SampleServiceImpl implements SampleService {
	
	@Autowired
	private SampleDao sampleDao;

	@Override
	public String name(String str) {
		if (str.equals("index")) {
			return "index";
		} else if(str.equals("home")) {
			return "h5/home";
		} else {
			return "h5/name";
		}
	}

	@Override
	public String selectUserByName(String name) {
		User user = sampleDao.selectUserByName(name);
		String str = "姓名：" + user.getName() + "，年龄：" + user.getAge();
		return str;
	}

	@Override
	public User selectUserListByName(String name) {
		return sampleDao.selectUserListByName(name);
	}

}
